<?php
namespace app\qian\controller;

use think\Controller;
use app\qian\model\CmModel as CmModels;
use think\Db;

class Cm extends Controller
{
    private $cModel;   //当前控制器关联模型

    public function _initialize()
    {
        parent::_initialize();
        $this->cModel = new CmModels;   //别名：避免与控制名冲突
    }

    public function index()
    {
        if($this->request->isPost()){
            ECHO 1 ;
        }else{
            $dataList=Db::table('dy_ng')->select();
            $this->assign('dataList', $dataList);
            $na = Db::table('dy_tv')->join('dy_tv_type a','a.id=dy_tv.fid')->
            field('dy_tv_type.id,type,dy_tv.id,title,pic,contect,dy_tv_type.status,dy_tv.status,dy_tv.create_time,dy_tv.update_time,dy_tv_type.create_time,dy_tv_type.update_time,jid ')->where(['jid'=> 1])->paginate('3', false, page_param());
            $this->assign('na', $na);

            return view('dianshiju');
        }
    }


}